<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>测评中心知识库</title>

    <!-- Bootstrap Core CSS -->
    <link href="../css/bootstrap.css" rel="stylesheet">

    <!-- Font Icons -->
    <link href="../css/font-awesome.css" rel="stylesheet">

    <!-- Animate -->
    <link href="../css/animate.css" rel="stylesheet">

    <!-- Bootsnav -->
    <link href="../css/bootsnav.css" rel="stylesheet">
    <link href="../css/overwrite.css" rel="stylesheet">
    <link href="../css/color.css" rel="stylesheet">
    <link href="../css/style.css" rel="stylesheet">


</head>
<body>


<!-- Start Navigation -->
<nav class="navbar navbar-inverse navbar-fixed-top  bootsnav">
    <div class="container">
        <!-- Start Header Navigation -->
        <div class="navbar-header">
            <a class="navbar-brand" href="/index.html">
                <img src="/images/brand/logo.png" class="logo" alt="LOGO">
            </a>
        </div>
        <div></div>
        <!-- End Header Navigation -->


        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="navbar-menu">
            <ul class="nav navbar-nav navbar-right" data-in="fadeInDown" data-out="fadeOutUp">
                <li>
                    <a href="/index.html" >首页</a>
                </li>
                <li class="dropdown">
                    <a href="/capability/main.html" class="dropdown-toggle" data-toggle="dropdown">测评能力</a>
                    <ul class="dropdown-menu" id="capMenu">
                    </ul>
                </li>
                <li>
                    <a href="/testCase/main.html" class="active">案例库</a>
                </li>
                <li>
                    <a href="/zsk/index01.html">知识库</a>
                </li>
                <li>
                    <a onclick="javascript:showModalDialog()" style="cursor:pointer">关于我们</a>
                </li>
            </ul>
        </div><!-- /.navbar-collapse -->
    </div>
</nav>
<!-- End Navigation -->


<!-- end banner -->

<!--start content-->
<div class="container">
    <div class="content" id="page">

        <ul class="breadcrumb">
            <li>
                <i class="fa fa-home home-icon"></i>
                <a href="main.html">案例库</a>
            </li>
            <li class="active"></li>
        </ul>

        <div align="center">
            <h1><span id="pgTitle"></span></h1><br>
            &nbsp;&nbsp;<span id="pgAddTime" class="text-muted"></span>&nbsp;&nbsp;<span id="pgViewCount" class="text-muted"></span>
        </div>
        <div  id="pgSummary">
        </div>
        <div id="pgText">
        </div>
    </div>


</div>
    <!--end content-->
<!-- 点击"关于我们后弹窗 -->
<div class="modal fade" id="popWin" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog modal-lg" >
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span
                        class="sr-only">Close</span></button>
            </div>
            <div class="modal-body">
                <div class="embed-responsive embed-responsive-16by9">
                    <iframe class="embed-responsive-item"  id="aboutUs"></iframe>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- 弹窗结束 -->
    <footer class="main-footer">
        <div class="container">
            <div class="row">
                <div class="col-md-6 qrcode">
                    <img src="../images/qrcode.gif" width="90" height="90">

                    <p> 扫一扫关注我们的微信公众号</p>
                </div>
                <div class="col-md-6">
                    <ul class="list-unstyled">
                        <li>
                            <i class="fa fa-phone"></i> 020-51856688
                        </li>
                        <li>
                            <i class="fa fa-envelope-o"></i> yhtycp@139.com
                        </li>
                        <li>
                            <i class="fa fa-location-arrow"></i>广州市天河区高塘路636号
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </footer>

    <div class="copyright">
        <div class="container">
            <div class="row">
                <div class="col-sm-12">
                    <span><a href="http://www.miibeian.gov.cn/" target="_blank">京ICP备11008151号</a></span>&nbsp;&nbsp;
                    <span> Copyright &copy; 中国移动版权所有</span>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-12">
                    <span>中华人民共和国增值业务经营许可证编号：A2B1B2-201000001</span>
                </div>
            </div>
        </div>
    </div>


<!-- START JAVASCRIPT -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="../js/jquery.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<!-- utility scripts -->
<script src="../admin/js/util.js" type="text/javascript"></script>
<!-- Bootsnavs -->
<script src="../js/bootsnav.js"></script>
<script>
    (function ($) {
        $.getUrlParam = function (name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
            var r = window.location.search.substr(1).match(reg);
            if (r != null) return r[2];
            return null;
        }
    })(jQuery);
    var id;
    $(function () {
        //加载测评能力菜单
        getCapabilityInfo();
       id = $.getUrlParam('id');

        //加载栏目信息
        $.ajax({
            type : "get", //默认为get
            dataType : "json",
            cache:false,
            url :  "/api/admin/content/id/" + id,
            success : function(response){
                if (response && response.code == "200") {
                    var example = response.data;
                    loadContent(example);
                }else {
                    console.log("获取测评能力信息失败！");
                    alert("获取测评能力信息失败！") ;
                }
            },
            error:function(){
                console.log("ajax error");
                alert("ajax error");
            }
        });

    });
    var getCapabilityInfo = function() {
        $.ajax({
            type : "get", //默认为get
            dataType : "json",
            cache:false,
            url :  "/api/category/lists?parentId=88",
            success : function(response){
                if (response && response.code == "200") {
                    var capabilities = response.data.items;
                    loadCapMenu(capabilities);
                }else {
                    console.log("获取测评能力信息失败！");
                    alert("获取测评能力信息失败！") ;
                }
            },
            error:function(){
                console.log("ajax error");
                alert("ajax error");
            }
        });
    }
    function loadCapMenu(capabilities) {
        $.each(capabilities, function(i,capability){
            var li = $("<li/>");
            var a = $("<a/>");
            var href = "/capability/detail.html?cid=" + capability.id + "&cname=" + capability.title ;
            a.attr("href",href);
            a.html(capability.title);
            $("#capMenu").append(li.append(a));
        });
    }
    function loadContent(content) {
        var page = $("#page");
        page.find("#pgTitle").html(content.title);
        page.find("#pgAddTime").html(new Date(content.addTime).Format("yyyy-MM-dd"));
        page.find("#pgViewCount").html(content.viewCount + "阅读");
        page.find("#pgSummary").html(content.summary).attr("class","summary");
        page.find("#pgText").html(content.text);
        var taxonomyArr = content.taxonomy;
        var taxonomy = taxonomyArr[taxonomyArr.length-1];
        var href = "main.html?cid=" + taxonomy.id;
        $(".breadcrumb>.active").html("<a href='" + href + "'>"+taxonomy.name+"</a>");
    }
    function showModalDialog() {
        var frameSrc = "/aboutUs.html";
        $("#aboutUs").attr("src", frameSrc);
        $('#popWin').modal("show");
    }
</script>

</body>
</html>